/**
 * @description 任务模型类
 * @author AI Assistant
 * @date 2023-10-27
 */

import { BaseModel } from './base'

export class Task extends BaseModel {
  constructor(data = {}) {
    super(data)
    this.title = data.title || ''
    this.description = data.description || ''
    this.priority = data.priority || 'none'
    this.tags = data.tags || []
    this.groupId = data.groupId || ''
    this.deadline = data.deadline || 0
    this.status = data.status || 'todo'
    this.order = data.order || 0
  }

  toJSON() {
    return {
      ...super.toJSON(),
      title: this.title,
      description: this.description,
      priority: this.priority,
      tags: this.tags,
      groupId: this.groupId,
      deadline: this.deadline,
      status: this.status,
      order: this.order
    }
  }
} 